'use strict';
const db = uniCloud.database()
exports.main = async ({action,params}, context) => {
	const collection = db.collection('notice')
	let res =null;
	if(action=="add"){
		res = await collection.add(params)
	}else if(action=="get"){
		res = await collection.where({type:params.type}).get()
	}
	return res
};

